<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form method="post" action="?" id="dform" onsubmit="return check();">
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
<input type="hidden" name="file" value="<?php echo $file;?>"/>
<input type="hidden" name="action" value="<?php echo $action;?>"/>
<input type="hidden" name="forward" value="<?php echo $forward;?>"/>
<div class="tt"><?php echo $action == 'add' ? '添加' : '修改';?>邮件推送用户</div>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
<td class="tl">邮箱</td>
<td>
<textarea name="post[email]" cols="80" rows="5"><?php echo $email;?></textarea>(多个邮箱用';'分隔开)
</td>
</tr>

<tr>
<td class="tl">区域
(
<a onclick="selectall()"/>全选</a>/
<a onclick="selectno()"/>全不选</a>/
<a onclick="r()"/>反选</a>
)
</td>
<td>

<?php foreach($quyu as $a=>$b){?>
<input type="checkbox" name="post[filteraddress][]" value="<?php echo $b['areaid']?>" <?php if (in_array($b['areaid'], $dq1)){echo "checked";}?>/><?php echo $b['areaname'];?>&nbsp;
<?php }?>
</td>
</tr>

<script language="javascript">
 function selectall(){
	 for(i=0;i<document.getElementsByName("post[filteraddress][]").length;i++)
	 {
	 document.getElementsByName("post[filteraddress][]")[i].checked = "checked";
	 }
 }
 function selectno(){
	 for(i=0;i<document.getElementsByName("post[filteraddress][]").length;i++)
	 {
	 document.getElementsByName("post[filteraddress][]")[i].checked = false;
	 }
 }
function r(){
 for(i=0;i<document.getElementsByName("post[filteraddress][]").length;i++)
 {
  if(document.getElementsByName("post[filteraddress][]")[i].checked == false)
  {
   document.getElementsByName("post[filteraddress][]")[i].checked = "checked";
  }
  else document.getElementsByName("post[filteraddress][]")[i].checked = false;
 } 
}
 </script>


<tr>
<td class="tl">行业
(
<a onclick="selectall1()"/>全选</a>/
<a onclick="selectno1()"/>全不选</a>/
<a onclick="r1()"/>反选</a>
)
</td>
<td>
<?php foreach($hangye as $a=>$b){?>
<input type="checkbox" name="post[filtercategory][]" value="<?php echo $b['fid']?>" <?php if (in_array($b['fid'], $hangye1)){echo "checked";}?>/><?php echo $b['f_cat_name'];?>&nbsp;
<?php }?>
<script language="javascript">
 function selectall1(){
	 for(i=0;i<document.getElementsByName("post[filtercategory][]").length;i++)
	 {
	 document.getElementsByName("post[filtercategory][]")[i].checked = "checked";
	 }
 }
 function selectno1(){
	 for(i=0;i<document.getElementsByName("post[filtercategory][]").length;i++)
	 {
	 document.getElementsByName("post[filtercategory][]")[i].checked = false;
	 }
 }
function r1(){
 for(i=0;i<document.getElementsByName("post[filtercategory][]").length;i++)
 {
  if(document.getElementsByName("post[filtercategory][]")[i].checked == false)
  {
   document.getElementsByName("post[filtercategory][]")[i].checked = "checked";
  }
  else document.getElementsByName("post[filtercategory][]")[i].checked = false;
 } 
}
 </script>

</td>
</tr>
<tr>
<td class="tl">招标
(
<a onclick="selectall2()"/>全选</a>/
<a onclick="selectno2()"/>全不选</a>/
<a onclick="r2()"/>反选</a>
)
</td>
<td>
<?php foreach($category as $a=>$b){?>
<input type="checkbox" name="post[filtertender][]" value="<?php echo $b['catid']?>" <?php if (in_array($b['catid'], $cat)){echo "checked";}?>/><?php echo $b['catname'];?>&nbsp;
<?php }?>
<script language="javascript">
 function selectall2(){
	 for(i=0;i<document.getElementsByName("post[filtertender][]").length;i++)
	 {
	 document.getElementsByName("post[filtertender][]")[i].checked = "checked";
	 }
 }
 function selectno2(){
	 for(i=0;i<document.getElementsByName("post[filtertender][]").length;i++)
	 {
	 document.getElementsByName("post[filtertender][]")[i].checked = false;
	 }
 }
function r2(){
 for(i=0;i<document.getElementsByName("post[filtertender][]").length;i++)
 {
  if(document.getElementsByName("post[filtertender][]")[i].checked == false)
  {
   document.getElementsByName("post[filtertender][]")[i].checked = "checked";
  }
  else document.getElementsByName("post[filtertender][]")[i].checked = false;
 } 
}
 </script>


</td>
</tr>
<tr>
<td class="tl">手机号</td>
<td>
<input type="telephone" name="post[telephone]" value="<?php echo $telephone?>" size="20"/>
</td>
</tr>
<tr>
<td class="tl">公司名称</td>
<td>
<input type="text" name="post[company]" value="<?php echo $company?>" size="20"/>
</td>
</tr>
<tr>
<td class="tl">联系人</td>
<td>
<input type="text" name="post[lxr]" value="<?php echo $lxr?>" size="20"/>
</td>
</tr>
<tr>
<td class="tl">备注</td>
<td>
<textarea name="post[beizhu]" cols="80" rows="5"><?php echo $beizhu;?></textarea>
</td>
</tr>

<tr>
<td class="tl">邮件推送</td>
<td>
<input type="radio" name="post[pushemail]" value="1" checked="checked"/>开启
<input type="radio" name="post[pushemail]" value="0"/>关闭

</td>
</tr>
<tr>
<td class="tl">添加时间</td>
<td><input type="text" name="post[addtime]" value="<?php echo date("Y-m-d,H:i:s",time());?>"></td>
</tr>
<tr>
<td class="tl">推送状态</td>
<td>
<input type="radio" name="post[pushstatus]" value="1" <?php if($pushstatus==1){echo "checked";}?>/>冻结
<input type="radio" name="post[pushstatus]" value="2" <?php if($pushstatus==2){echo "checked";}?>/>试用到期
<input type="radio" name="post[pushstatus]" value="3" <?php if($pushstatus==3){echo "checked";}?>/>试用中
<input type="radio" checked="checked" name="post[pushstatus]" value="4" <?php if($pushstatus==4){echo "checked";}?>/>长期推送
<input type="radio" name="post[pushstatus]" value="5" <?php if($pushstatus==5){echo "checked";}?>/>关注未推送



</td>
</tr>
</table>
<div class="sbt"><input type="submit" name="submit" value=" 确 定 " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="btn"/></div>
</form>
<?php load('clear.js'); ?>


</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>